<?php

/**
 * MailingList form.
 *
 * @package    form
 * @subpackage MailingList
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
 */
class MailingListForm extends BaseMailingListForm
{
  	public function configure()
  	{
  		parent::configure();
		
  		$this->widgetSchema['id_mailing_group'] = new sfWidgetFormDoctrineChoice(
  			array('model' => 'MailingGroup', 'add_empty' => '-- Grupo --')
  		);
  		
  		$this->widgetSchema['ds_nome_list'] = new sfWidgetFormInput(
  			array(),
  			array('size' => '70', 'class' => 'required')
  		);
  		$this->widgetSchema['ds_email_list'] = new sfWidgetFormInput(
  			array(),
  			array('size' => '70', 'class' => 'required')
  		);
  		
  		$this->widgetSchema['ds_mailing'] = new sfWidgetFormTextarea(
			array(),
			array('id' => 'tinymce')
        );
        
        $options = array('1'=>'Sim', '0'=>'Não');
		$this->widgetSchema['st_mailing_list'] = new sfWidgetFormChoice(
			array('choices'=>$options, 'expanded'=>true, 'multiple'=>false)
		);
		
        $options = array('1'=>'Sim', '0'=>'Não');
		$this->widgetSchema['st_envio_list'] = new sfWidgetFormChoice(
			array('choices'=>$options, 'expanded'=>true, 'multiple'=>false)
		);
		
		$this->widgetSchema['created_at'] = new sfWidgetFormInputHidden();
		$this->widgetSchema['updated_at'] = new sfWidgetFormInputHidden();
  		
  		$this->widgetSchema->setLabels(array(
  	      	'id_mailing_list'  => 'ID#',
	      	'id_mailing_group' => 'Grupo',
	      	'ds_nome_list'     => 'Nome',
	      	'ds_email_list'    => 'E-mail',
	      	'st_mailing_list'  => 'Ativo',
	      	'st_envio_list'    => 'Envio',
	      	'dt_envio_list'    => 'Data do envio',
	      	'created_at'       => 'Criado em',
	      	'updated_at'       => 'Atualizado em',
	      	'deleted'          => 'Deletado',
		));
  	}
}